package text;

import TCP2.Server;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;

public class Sever {
    public static void main(String[] args) throws IOException {
        //接收数据
        ServerSocket ss = new ServerSocket(10002);
        //获取输出流
        Socket scoket = ss.accept();
        InputStream is = scoket.getInputStream();
        InputStreamReader isr=new InputStreamReader(is);
        BufferedReader br=new BufferedReader(isr);

        int b;
        while ((b=br.read())!=-1)
        {
            System.out.print((char)b);
        }


        scoket.close();
        ss.close();
    }
}
